//
//  HelloButton.m
//  Hello
//
//  Created by Detailscool on 16/3/17.
//  Copyright © 2016年 Detailscool. All rights reserved.
//

#import "HelloButton.h"

@implementation HelloButton

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (void)layoutSubviews {
    [super layoutSubviews];
    
    self.imageView.height = self.height*0.5;
    self.imageView.width = self.imageView.height;
    self.imageView.y = (self.height - self.imageView.height)*0.5;
    
    [self.titleLabel sizeToFit];
    self.titleLabel.x = CGRectGetMaxX(self.imageView.frame)+5;
    self.titleLabel.y = (self.height - self.titleLabel.height) * 0.5;
    
}

@end
